<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of shippingcom_model
 *
 * @author hassanali
 */
class categories_model extends admin_model {

    //put your code here
    public function __construct() {
        parent::__construct();
        $this->table = 'categories';
    }
    
    function aftertrash($param = FALSE) {
        parent::aftertrash($param);
        $this->db->set('parent', '0');
        if (count($where)) {
            foreach ($where as $column => $values)
                if (is_array($values)) {
                    $this->db->where_in($column, $values);
                } else {
                    $this->db->where($column, $values);
                }
        }
        if (count($or_where)) {
            foreach ($or_where as $column => $values)
                if (is_array($values)) {
                    $this->db->or_where_in($column, $values);
                } else {
                    $this->db->or_where($column, $values);
                }
        }

        $this->db->where('trash', 'YES');
        $this->db->update($this->table);
    }

}

?>
